function [L] = l(i,j,nx)
L = i+(j-1)*(nx+1);